//
//  LLDispatchMacrocDefine.h
//  LLFoundation
//
//  Created by my_liu on 2016/11/14.
//  Copyright © 2016年 . All rights reserved.
//
/**
 *  文件描述
 *
 *  这个工具类宏可以方便在各种队列中执行block,提供便捷的使用方法
 *  是对GCD的一个简单封装
 */

#import "LLDispatchCenterUitil.h"

/**
 *  主线程异步执行block
 */
#define LLAsyncMainQueue(block) [LLDispatchCenterUitil asyncMainQueue:block]

/**
 *  主线程延迟second秒异步执行block
 */
#define LLAsyncMainQueueDelay(second,block) [LLDispatchCenterUitil asyncMainQueue:block delay:second]

/**
 *  全局后台线程异步执行block
 */
#define LLAsyncGlobalBackgroundQueue(block) [LLDispatchCenterUitil asyncGlobalBackgroundQueue:block]

/**
 *  全局后台线程延迟second秒异步执行block
 */
#define LLAsyncGlobalBackgroundQueueDelay(second,block) [LLDispatchCenterUitil asyncGlobalBackgroundQueue:block delay:second]

/**
 *  全局高优先级线程异步执行block
 */
#define LLAsyncGlobalHighQueue(block) [LLDispatchCenterUitil asyncGlobalHighQueue:block]

/**
 *  全局高优先级线程延迟second秒异步执行block
 */
#define LLAsyncGlobalHighQueueDelay(second,block) [LLDispatchCenterUitil asyncGlobalHighQueue:block delay:second]

/**
 *  全局低优先级线程异步执行block
 */
#define LLAsyncGlobalLowQueue(block) [LLDispatchCenterUitil asyncGlobalLowQueue:block]

/**
 *  全局低优先级线程延迟second秒异步执行block
 */
#define LLAsyncGlobalLowQueueDelay(second,block) [LLDispatchCenterUitil asyncGlobalLowQueue:block delay:second]

/**
 *  全局默认线程异步执行block
 */
#define LLAsyncGlobalDefaultQueue(block) [LLDispatchCenterUitil asyncGlobalDefaultQueue:block]

/**
 *  全局默认线程延迟second秒异步执行block
 */
#define LLAsyncGlobalDefaultQueueDelay(second,block) [LLDispatchCenterUitil asyncGlobalDefaultQueue:block delay:second]

/**
 *  在queue线程队列异步执行block
 */
#define LLAsync(queue,block)  [LLDispatchCenterUitil asyncQueue:queue action:block]

/**
 *  在queue线程序延迟second秒异步执行block
 */
#define LLAsyncDelay(queue,second,block)  [LLDispatchCenterUitil asyncQueue:queue action:block delay:second]

/**
 *  只执行一次block,创建单例使用
 */
#define LLDispatchOnce(onceToken,block) [LLDispatchCenterUitil dispatchOnce:onceToken action:block]

/**
 *  主线程异步
 */
#define LLAsyncMainThread(mainQueueBlock) dispatch_async(dispatch_get_main_queue(), mainQueueBlock);
/**
 *  全局异步执行
 */
#define LLAsyncOpenGlobal(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);

